﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ClientDetail.aspx.cs" Inherits="WEB.APP.Modules.List.ClientDetail" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function DeleteData() {
            if (txtClientId.getValue() === null || txtClientId.getValue() === '')
                return;
            Ext.Msg.confirm('Delete the data', 'Are you sure you want to remove this data?', function (btn) {
                if (btn === 'yes') {
                    MethodNamespace.Delete();
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:Hidden runat="server" ID="hfIsEdit" />
    <ext:Hidden runat="server" ID="hfIsDelete" />
    <ext:Hidden runat="server" ID="hfPassword" />
    <ext:Store ID="storeExpertise" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="ExpertiseId">
                <Fields>
                    <ext:RecordField Name="ExpertiseId" />
                    <ext:RecordField Name="Name" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
        <Items>
            <ext:FormPanel ID="winDetails" runat="server" TrackMouseOver="true" Border="false" Region="Center" Padding="10" MonitorValid="true" >
                <TopBar>
                    <ext:Toolbar ID="tbMain" runat="server">
                        <Items>
                            <ext:ToolbarSpacer />
                            <ext:Button ID="btnAdd" runat="server" Text="New" Icon="New">
                                <DirectEvents>
                                    <Click OnEvent="btnAdd_Click" />
                                </DirectEvents>
                            </ext:Button>
                            <ext:ToolbarSeparator runat="server" ID="tbsAdd" />
                            <ext:Button ID="btnDelete" runat="server" Text="Delete" Icon="Delete">
                                <Listeners>
                                    <Click Handler="DeleteData();" />
                                </Listeners>
                            </ext:Button>
                            <ext:ToolbarSpacer />
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:DisplayField ID="DisplayField1" runat="server" Text="<span style='color: Red;'>*</span> is Required field" HideLabel="True" />
                    <ext:FieldSet ID="FieldSet1" runat="server" Layout="FormLayout" Padding="8" MaxWidth="400" AutoHeight="true">
                        <Defaults>
                            <ext:Parameter Name="Anchor" Value="99%" />
                        </Defaults>
                        <Items>
                            <ext:TextField ID="txtClientId" FieldLabel="Client ID" runat="server" Disabled="true">
                            </ext:TextField>
                            <ext:TextField ID="txtClientType" FieldLabel="Client Type" runat="server" EnableKeyEvents="true" MaxLength="50">
                            </ext:TextField>
                            <ext:TextField ID="txtSurName" FieldLabel="Sur Name<span style='color: Red;'>*</span>" runat="server" EnableKeyEvents="true"
                                MaxLength="50" AllowBlank="false">
                            </ext:TextField>
                            <ext:TextField ID="txtGivenName" FieldLabel="Given Name<span style='color: Red;'>*</span>" runat="server" EnableKeyEvents="true"
                                MaxLength="50" AllowBlank="false">
                            </ext:TextField>
                            <ext:ComboBox runat="server" ID="cboSex" FieldLabel="Sex<span style='color: Red;'>*</span>" Editable="false" AllowBlank="false">
                                <Items>
                                    <ext:ListItem Text="Male" Value="True" />
                                    <ext:ListItem Text="Female" Value="False" />
                                </Items>
                            </ext:ComboBox>
                            <ext:TextField ID="txtEmail" FieldLabel="Email<span style='color: Red;'>*</span>" runat="server" EnableKeyEvents="true"
                                MaxLength="50" AllowBlank="false">
                            </ext:TextField>
                            <ext:TextField ID="txtAddr1" FieldLabel="Addr 1<span style='color: Red;'>*</span>" runat="server" EnableKeyEvents="true"
                                MaxLength="200" AllowBlank="false">
                            </ext:TextField>
                            <ext:TextField ID="txtAddr2" FieldLabel="Addr 2" runat="server" EnableKeyEvents="true"
                                MaxLength="200">
                            </ext:TextField>
                            <ext:TextField ID="txtAddr3" FieldLabel="Addr 3" runat="server" EnableKeyEvents="true"
                                MaxLength="200">
                            </ext:TextField>
                            <ext:TextField ID="txtAddr4" FieldLabel="Addr 4" runat="server" EnableKeyEvents="true"
                                MaxLength="200">
                            </ext:TextField>
                            <ext:TextField ID="txtAddr5" FieldLabel="Addr 5" runat="server" EnableKeyEvents="true"
                                MaxLength="200">
                            </ext:TextField>
                        </Items>
                    </ext:FieldSet>
                    <ext:FieldSet ID="FieldSet2" runat="server" Layout="FormLayout" Padding="8" MaxWidth="400" AutoHeight="true">
                        <Defaults>
                            <ext:Parameter Name="Anchor" Value="99%" />
                        </Defaults>
                        <Items>
                            <ext:TextField ID="txtUserName" runat="server" FieldLabel="Username<span style='color: Red;'>*</span>" AnchorHorizontal="100%"
                                AllowBlank="false" MinLength="3" />
                            <ext:TextField ID="txtPassword" runat="server" FieldLabel="Password<span style='color: Red;'>*</span>" InputType="Password"
                                Anchor="100%" AllowBlank="false" MinLength="3" />
                            <ext:TextField ID="txtConfirmPassword" runat="server" FieldLabel="Confirm Password<span style='color: Red;'>*</span>" InputType="Password"
                                AnchorHorizontal="100%" Vtype="password" VtypeText="The entered passwords do not match."
                                AllowBlank="false" MinLength="3">
                                <CustomConfig>
                                    <ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Value" />
                                </CustomConfig>
                            </ext:TextField>
                        </Items>
                    </ext:FieldSet>
                    <ext:Panel ID="plButton" runat="server" MaxWidth="400" Border="false" LabelWidth="30" Layout="HBoxLayout" Margins="Auto">
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Align="Middle" Pack="Center" />
                        </LayoutConfig>
                        <Items>
                            <ext:Button ID="btnSave" runat="server" Text="Save" Icon="Disk">
                                <DirectEvents>
                                    <Click OnEvent="btnSave_Click" />
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Panel>
                </Items>
                <Listeners>
                    <ClientValidation Handler="#{btnSave}.setDisabled(!valid);" />
                </Listeners>
            </ext:FormPanel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
